﻿#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
#endregion

namespace WpfFootball.UI
{
    /// <summary>
    /// Interaction logic for ExternalViewWindow.xaml
    /// </summary>
    public partial class ExternalViewWindow : Window
    {
        #region Fiels
        //private BaseView pluggedView;
        #endregion

        public ExternalViewWindow()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Plugs a view to this window.
        /// </summary>
        /// <param name="view">The view to plug into this window.</param>
        public void PlugView()
        {
            /*view.AbortAutoUpdateThread();
            pluggedView = view;
            
            Width = pluggedView.Width + 5;
            Height = pluggedView.Height + 20;
            grid1.Width = pluggedView.Width;
            grid1.Height = pluggedView.Height;
            Canvas.SetLeft(pluggedView, -10);
            Canvas.SetTop(pluggedView, -10);
            ResizeMode = System.Windows.ResizeMode.NoResize;
            SetWindowTitle();

            canvas1.Children.Add(pluggedView);*/
            Show();
        }

        public void SetWindowTitle()
        {
            /*switch (pluggedView.viewKind)
            {
                case Parser.ViewKind.FORUM:
                    Title = pluggedView.teamName + " forum";
                    break;
                case Parser.ViewKind.NEWS:
                    Title = pluggedView.teamName + " nyheter";
                    break;
                case Parser.ViewKind.FIXTURES:
                    Title = pluggedView.teamName + " matcher";
                    break;
            }*/
        }

        private void Window_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
        {
            //this.DragMove();
        }

        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            /*if (pluggedView != null)
            {
                pluggedView.CloseView();
                canvas1.Children.Remove(pluggedView);
            }*/
            /*Window w = MainWindow.GetWindowRef();
            w.Close();*/
        }
    }
}
